function efficiency_load_exp()
close all;
clc;

%% Efficiency vs Iload

figure;
cc=hsv(5);
marker={'x-'; 'o-';'^-';'s-'};

M1 = csvread('./data/hard_charging/250k_150V_3A_short.dat',1,0);
efficiency=M1(2:end,7);
load=M1(2:end,4);
plot(load,efficiency*100,marker{1},'color','r','LineWidth',0.8);
hold on;

% M1 = csvread('./data/hard_charging_old/SC_hard_90.dat',1,0);
% efficiency=M1(2:end,7);
% load=M1(2:end,4);
% plot(load,efficiency,marker{1},'color',cc(2,:),'LineWidth',1.2);

M1 = csvread('./data/hard_charging/250k_180V_2A_short.dat',1,0);
efficiency=M1(2:end,7);
load=M1(2:end,4);
plot(load,efficiency*100,marker{4},'color','r','LineWidth',0.8);


M4 = csvread('./data/soft_charging_2/250k_150V_3A_short.dat',1,0);
efficiency=M4(2:end,7);
load=M4(2:end,4);
plot(load,efficiency*100,marker{1},'color','b','LineWidth',1.2);

M5 = csvread('./data/soft_charging_2/250k_180V_2A_short.dat',1,0);
efficiency=M5(2:end,7);
load=M5(2:end,4);
plot(load,efficiency*100,marker{4},'color','b','LineWidth',1.2);

legendInfo = {'Vin= 150V, hard-charging','Vin= 180V, hard-charging','Vin= 150V, soft-charging','Vin= 180V, soft-charging'};

xlabel('Load current (A)');
ylabel('Efficiency (%)');
grid on;
ylim([85 95]);
xlim([0 3.5]);
set_figure_style;
legend(legendInfo,'Location','SouthEast');
resize_figure();
print('-depsc2', './images/efficiency_unregulated_compare_exp');
% matlab2tikz( '../Paper/images/efficiency_unregulated_exp.tikz',  'height', '\figureheight', 'width', '\figurewidth','showInfo', false);

%% Efficiency vs Pout
figure;
cc=hsv(5);

M1 = csvread('./data/hard_charging/250k_150V_3A_short.dat',1,0);
efficiency=M1(2:end,7);
load=M1(2:end,6);
plot(load,efficiency*100,'rx-','LineWidth',0.6);
hold on;

M1 = csvread('./data/hard_charging/250k_180V_2A_short.dat',1,0);
efficiency=M1(2:end,7);
load=M1(2:end,6);
plot(load,efficiency*100,'rs-','LineWidth',0.6);


M4 = csvread('./data/soft_charging_2/250k_150V_3A_short.dat',1,0);
efficiency=M4(2:end,7);
load=M4(2:end,6);
plot(load,efficiency*100,'bx-','LineWidth',1.4);

M5 = csvread('./data/soft_charging_2/250k_180V_2A_short.dat',1,0);
efficiency=M5(2:end,7);
load=M5(2:end,6);
plot(load,efficiency*100,'bs-','LineWidth',1.4);

legendInfo = {'Vin= 150V, hard-charging','Vin= 180V, hard-charging','Vin= 150V, soft-charging','Vin= 180V, soft-charging'};

xlabel('Output power (W)');
ylabel('Efficiency (%)');
set_figure_style;
legend(legendInfo,'Location','SouthEast');

ylim([85 95]);
% xlim([0 3.5]);

% set(gca,'xcolor',[0.75 0.75 0.75],'ycolor',[0.75 0.75 0.75])
% set(gca,'MinorGridLineStyle','-')
grid on
% c=copyobj(gca,gcf);
% set(c,'color','none','xcolor','k', ...
% 'xgrid','off','ycolor','k', ...
% 'ygrid','off');
set_figure_style;
resize_figure();
print('-depsc2', './images/efficiency_pout_unregulated_compare_exp');
% matlab2tikz( '../Paper/images/efficiency_unregulated_exp.tikz',  'height', '\figureheight', 'width', '\figurewidth','showInfo', false);

%% Power loss vs Pout
figure;
cc=hsv(5);

M1 = csvread('./data/hard_charging/250k_150V_3A_short.dat',1,0);
ploss=M1(2:end,5)-M1(2:end,6);
load=M1(2:end,6);
plot(load,ploss,'rx-','LineWidth',0.6);
hold on;

M1 = csvread('./data/hard_charging/250k_180V_2A_short.dat',1,0);
ploss=M1(2:end,5)-M1(2:end,6);
load=M1(2:end,6);
plot(load,ploss,'rs-','LineWidth',0.6);


M4 = csvread('./data/soft_charging_2/250k_150V_3A_short.dat',1,0);
ploss=M4(2:end,5)-M4(2:end,6);
load=M4(2:end,6);
plot(load,ploss,'bx-','LineWidth',1.4);

M5 = csvread('./data/soft_charging_2/250k_180V_2A_short.dat',1,0);
ploss=M5(2:end,5)-M5(2:end,6);
load=M5(2:end,6);
plot(load,ploss,'bs-','LineWidth',1.4);

legendInfo = {'Vin= 150V, hard-charging','Vin= 180V, hard-charging','Vin= 150V, soft-charging','Vin= 180V, soft-charging'};

xlabel('Output power (W)');
ylabel('Power loss (W)');
legend(legendInfo,'Location','NorthWest');

ylim([0 7]);
% xlim([0 3.5]);

% set(gca,'xcolor',[0.75 0.75 0.75],'ycolor',[0.75 0.75 0.75])
% set(gca,'MinorGridLineStyle','-')
grid on
% c=copyobj(gca,gcf);
% set(c,'color','none','xcolor','k', ...
% 'xgrid','off','ycolor','k', ...
% 'ygrid','off');

set(gcf, 'Position', [200 200 450 260])
set(gcf,'PaperPositionMode','auto')
% print('-depsc2', './images/ploss_pout_unregulated_compare_exp');
% matlab2tikz( '../Paper/images/efficiency_unregulated_exp.tikz',  'height', '\figureheight', 'width', '\figurewidth','showInfo', false);

